#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const int MAXN = 1e6 + 10;

int check(int t[], int s) {
    sort(t, t + 5);
    // cout << t[0] << t[1] << t[2] << t[3] << t[4] << endl;
    // cout << (double)(t[1] + t[2] + t[3]) / 3 << endl;
    return (double)(t[1] + t[2] + t[3]) / 3 <= s;
}

int main(int argc, char const *argv[]) {
    int tt[5], ta;
    for (int i = 0; i < 4; i++) {
        double aa = 0;
        cin >> aa;
        tt[i] = (int)(aa * 100 + 0.5);
    }
    double ss;
    cin >> ss;
    ta = (int)(ss * 100 + 0.5);
    int ans = 0, cnt = 0;
    for (int i = 0; i <= 2001; i++) {
        int t[5];
        for (int j = 0; j < 4; j++) {
            t[j] = tt[j];
        }
        t[4] = i;
        // cout << tt[1] << endl;
        int temp = check(t, ta);
        if (temp) {
            ans = max(i, ans);
            cnt++;
        }
    }
    if (cnt == 0) {
        cout << "impossible" << endl;
    } else if (cnt == 2002) {
        cout << "infinite" << endl;
    } else {
        cout << fixed << setprecision(2) << (double)ans / 100 << endl;
    }
    return 0;
}

// 1 2 3 4 4 4 3 2 1 1 1 2
// 1 1 1 0 0 -1 -1 -1 0 0 1
// 0 0 -1 -1 -1 0 0
// 1 1 1 -1 -1 -1 1